Solana initial implementation, resolves FRONT-896#82
Merged
Conversation
…ration - Implemented SolanaHTLCClient and registration functions in index.ts - Created login module for Solana wallet signing - Added transaction builder for user lock transactions - Defined types for Solana signer and HTLC client configuration - Introduced utility function for converting secrets to buffers - Configured TypeScript settings for the Solana package - Updated pnpm lockfile to include Solana dependencies
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…transaction handling with instruction-based approach
…nnection components
…HTLC client - Use provider.name (not provider.id) for InternalConnector.providerName, AccountIdentity.providerName, and all downstream comparisons across useConnectors, ConnectorsList, evmConnectorsContext, MultichainConnectorPicker, swapAccounts, and AddressPicker - Surface e.message in UserLockAction error handler (was silently dropping errors when only e.name='Error' was present) - Replace Solana _getSolverLockDetails unbounded loop with getSolverLockCount-bounded loop, matching EVM/Starknet pattern - Remove single-tick setTimeout hack in walletLoginContext Solana path; check connected state explicitly instead - Validate amount string in toBaseUnits before constructing BN - Fix useHTLCWriteClient to pass resolved rpcUrl to Solana client instead of solanaConnection.rpcEndpoint (respects user RPC overrides) - Eliminate duplicate AnchorProvider construction in _getSolverLockDetails by routing through buildProgram with connection override - Add unit tests for SolanaHTLCClient.getUserLockDetails and refund (13 cases covering active lock, closed account log parsing, SOL/token paths, missing signer, confirmation errors)
… and guard native SOL by address
- useHTLCWriteClient: call adapter.sendTransaction() directly instead of
solanaSendTransaction() from context, fixing WalletNotConnectedError
when adapter is connected but WalletProvider context state is null
- Add NATIVE_SOL_ADDRESS constant ('11111111...') to types.ts
- Replace truthy contractAddress checks with explicit !== NATIVE_SOL_ADDRESS
guard in transactionBuilder, refund(), and redeemSolver()
- Fix solanaGasProvider: srcLpAddress field name, hashlock as hex string,
sourceAsset with decimals, as-any cast for dummy estimation params
…uilders - Replace contractAddress truthiness checks with explicit NATIVE_SOL_ADDRESS comparison in transactionBuilder and client (handles null from API correctly) - Add NATIVE_SOL_ADDRESS constant to constants.ts; replace all hardcoded system address strings in client.ts with it - Extract refundTransactionBuilder and redeemSolverTransactionBuilder from client.ts into transactionBuilder.ts; client now only handles sign/send/confirm - Remove useSolanaWalletStore: signMessage is now read from the live adapter directly in walletLoginContext (same pattern as sendTransaction) - Fix WalletNotConnectedError in useHTLCWriteClient: call adapter.sendTransaction directly instead of solanaSendTransaction from WalletProvider context - Fix gas estimation: correct lpAddress → srcLpAddress, hashlock type, contractAddress null-safety, and replace as any with proper dummy params - Rename phtlcTransactionBuilder export to userLockTransactionBuilder
- Removed the quoteExpiry parameter from the userLock method call, simplifying the parameter list. - Updated the return statement to include the nonce from params, ensuring a more comprehensive response. These changes improve the clarity and consistency of the SolanaHTLCClient implementation.
- Updated the signMessage function to directly call signMessage on the connected adapter, improving clarity and reducing unnecessary type casting. - Removed console log for starknetAccount to clean up the code and maintain focus on essential logic. These changes enhance the readability and maintainability of the wallet login context implementation.
…ferences - Added new dependencies: vitest and rimraf to pnpm-workspace.yaml. - Updated package.json files across multiple packages to reference dependencies from the catalog instead of specific versions for @coral-xyz/anchor, @solana/spl-token, and @solana/web3.js. - Ensured consistency in devDependencies by changing rimraf and vitest to catalog references in aztec, evm, solana, and starknet packages. These changes streamline dependency management and improve version control across the workspace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add Solana blockchain support with HTLC client and wallet integration